/*
 * FNISVGEditor - JavaScript - based editor for SVG graphics 
 * Copyright (C) 2008 - 2009 Antti Leppä / Foyt
 * http://www.foyt.fi
 * 
 * License: 
 * 
 * Licensed under GNU Lesser General Public License Version 2.1 or later (the "LGPL") 
 * http://www.gnu.org/licenses/lgpl.html
 */
FNISVGEditorElementAddUndoController = Class.create(FNISVGEditorUndoController, {
  initialize: function ($super) { 
    $super();
  },
  undo: function (editorInstance, event) {       
    var element = event.element;    
    editorInstance.removeElement(element);
    editorInstance.getSelectionManager().deselectElement(element);
  },
  redo: function (editorInstance, event) { 
    var element = event.element;
    editorInstance.appendSVGElement(element);    
  },
  getEventType: function () {
    return "elementAdd";
  }
});

GetFNISVGEditorUndoEventControllerVault().registerController(new FNISVGEditorElementAddUndoController());
